#!/bin/sh
set - u

#服务名称
appName="etrading-query"

#程序部署工作空间
dir=$(dirname `readlink -f $0`)
cd $dir

#停止的主程序jar
mainJar=`find $dir -name "${appName}*.jar"`
if [ -z "$mainJar" ]; then
    echo "app[${appName}] not found"
    exit
fi
echo "正在停止的jar是:"${mainJar}
PIDS=`ps -efww|grep "${mainJar}" |grep -v grep|awk '{print $2}'`
if [ "$PIDS" != "" ];then
	kill -9 $PIDS
	echo "${appName} shutdown sucess!"
else
	echo "${appName} is not running..."
fi

echo "0"
